home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Advisor / CD-ROM Advisor.iso / prodemo / demo / pdymain.dxr / 00006.ls < prev    next >
Encoding:
Text File  |  1995-09-29  |  3.3 KB  |  72 lines

  1. on mouseDown
  2.   global gIndexOfCurrentButton, gMouseDownInButton, gIsMainButton, gIsSmallButton, gChannelForHighLights, gNumberOfMainButtons, gCentersOfMainButtons, gMagicOffsetsOfMainButtons, gCastMemsOfMainButtons, gCentersOfSmallButtons, gMagicOffsetsOfSmallButtons, gCastMemsOfSmallButtons, gSmallButtonsOn
  3.   set hTemp to the mouseH
  4.   set vTemp to the mouseV
  5.   set gIndexOfCurrentButton to isPositionWithinMainButton(hTemp, vTemp)
  6.   if gIndexOfCurrentButton > 0 then
  7.     set gMouseDownInButton to 1
  8.     set gIsMainButton to 1
  9.     set the castNum of sprite gChannelForHighLights to getAt(gCastMemsOfMainButtons, gIndexOfCurrentButton)
  10.     set centerTemp to getAt(gCentersOfMainButtons, gIndexOfCurrentButton)
  11.     set offsetTemp to getAt(gMagicOffsetsOfMainButtons, gIndexOfCurrentButton)
  12.     set the visible of sprite gChannelForHighLights to 1
  13.     set the ink of sprite gChannelForHighLights to 0
  14.     set the locH of sprite gChannelForHighLights to getAt(centerTemp, 1) + getAt(offsetTemp, 1)
  15.     set the locV of sprite gChannelForHighLights to getAt(centerTemp, 2) + getAt(offsetTemp, 2)
  16.   else
  17.     if gSmallButtonsOn then
  18.       set gIndexOfCurrentButton to isPositionWithinSmallButton(hTemp, vTemp)
  19.       if gIndexOfCurrentButton > 0 then
  20.         set gMouseDownInButton to 1
  21.         set gIsSmallButton to 1
  22.         set the castNum of sprite gChannelForHighLights to getAt(gCastMemsOfSmallButtons, gIndexOfCurrentButton)
  23.         set centerTemp to getAt(gCentersOfSmallButtons, gIndexOfCurrentButton)
  24.         set offsetTemp to getAt(gMagicOffsetsOfSmallButtons, gIndexOfCurrentButton)
  25.         set the visible of sprite gChannelForHighLights to 1
  26.         set the ink of sprite gChannelForHighLights to 0
  27.         set the locH of sprite gChannelForHighLights to getAt(centerTemp, 1) + getAt(offsetTemp, 1)
  28.         set the locV of sprite gChannelForHighLights to getAt(centerTemp, 2) + getAt(offsetTemp, 2)
  29.       end if
  30.     end if
  31.   end if
  32. end
  33.  
  34. on mouseUp
  35.   global gIndexOfCurrentButton, gMouseDownInButton, gIsMainButton, gIsSmallButton, gChannelForHighLights, gNumberOfMainButtons, gLabelsForSmallButtonActions, gAnisForMainButtons, gAniHasBeenViewed, gNextLabel, gMovieToPlay, gSmallButtonsOn
  36.   if gMouseDownInButton then
  37.     set hTemp to the mouseH
  38.     set vTemp to the mouseV
  39.     if gIsMainButton then
  40.       set iButtonTemp to isPositionWithinMainButton(hTemp, vTemp)
  41.       if iButtonTemp = gIndexOfCurrentButton then
  42.         setAt(gAniHasBeenViewed, gIndexOfCurrentButton, 1)
  43.         set gMovieToPlay to 1
  44.         set countOfViewed to 0
  45.         repeat with iButCount = 1 to gNumberOfMainButtons
  46.           if getAt(gAniHasBeenViewed, iButCount) then
  47.             set countOfViewed to countOfViewed + 1
  48.           end if
  49.         end repeat
  50.         if countOfViewed < gNumberOfMainButtons then
  51.           set gNextLabel to "cont"
  52.           set gSmallButtonsOn to 1
  53.         else
  54.           set gNextLabel to "conc"
  55.           set gSmallButtonsOn to 1
  56.         end if
  57.       end if
  58.     else
  59.       if gSmallButtonsOn and gIsSmallButton then
  60.         set iButtonTemp to isPositionWithinSmallButton(hTemp, vTemp)
  61.         if iButtonTemp = gIndexOfCurrentButton then
  62.           set gNextLabel to getAt(gLabelsForSmallButtonActions, gIndexOfCurrentButton)
  63.         end if
  64.       end if
  65.     end if
  66.   end if
  67.   set the visible of sprite gChannelForHighLights to 0
  68.   set gMouseDownInButton to 0
  69.   set gIsMainButton to 0
  70.   set gIsSmallButton to 0
  71. end
  72.